package ${packageName};

import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import ${applicationPackage}.R;
import ${applicationPackage}.common.base.BaseFragment;

<#if needDagger>
import ${packageName}.dagger.Dagger${pageName}Component;
import ${packageName}.dagger.${pageName}Module;

import static ${applicationPackage}.common.base.BaseApplication.getAppComponent;
</#if>
public class ${pageName}Fragment extends BaseFragment<${pageName}Presenter> implements ${pageName}Contract.View{

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.${layoutName}, null);//注意不要指定父视图
        return view;
    }

    <#if needDagger>
 	@Override
    public void onAttach(Context context) {
        super.onAttach(context);
        Dagger${pageName}Component.builder()
                .appComponent(getAppComponent())
                .${pageName[0]?lower_case}${pageName?substring(1,pageName?length)}Module(new ${pageName}Module(this))
                .build().inject(this);
    }
</#if>
}
